package com.ruoyi.school.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.school.mapper.ProfessionMapper;
import com.ruoyi.school.domain.Profession;
import com.ruoyi.school.service.IProfessionService;

/**
 * 专业课程Service业务层处理
 * 
 * @author admin
 * @date 2023-08-31
 */
@Service
public class ProfessionServiceImpl implements IProfessionService 
{
    @Autowired
    private ProfessionMapper professionMapper;

    /**
     * 查询专业课程
     * 
     * @param id 专业课程主键
     * @return 专业课程
     */
    @Override
    public Profession selectProfessionById(Long id)
    {
        return professionMapper.selectProfessionById(id);
    }

    /**
     * 查询专业课程列表
     * 
     * @param profession 专业课程
     * @return 专业课程
     */
    @Override
    public List<Profession> selectProfessionList(Profession profession)
    {
        return professionMapper.selectProfessionList(profession);
    }

    /**
     * 新增专业课程
     * 
     * @param profession 专业课程
     * @return 结果
     */
    @Override
    public int insertProfession(Profession profession)
    {
        profession.setCreateTime(DateUtils.getNowDate());
        return professionMapper.insertProfession(profession);
    }

    /**
     * 修改专业课程
     * 
     * @param profession 专业课程
     * @return 结果
     */
    @Override
    public int updateProfession(Profession profession)
    {
        profession.setUpdateTime(DateUtils.getNowDate());
        return professionMapper.updateProfession(profession);
    }

    /**
     * 批量删除专业课程
     * 
     * @param ids 需要删除的专业课程主键
     * @return 结果
     */
    @Override
    public int deleteProfessionByIds(Long[] ids)
    {
        return professionMapper.deleteProfessionByIds(ids);
    }

    /**
     * 删除专业课程信息
     * 
     * @param id 专业课程主键
     * @return 结果
     */
    @Override
    public int deleteProfessionById(Long id)
    {
        return professionMapper.deleteProfessionById(id);
    }
}
